import matplotlib.pyplot as plt
import numpy as np
from test3 import create_polar_system

# 创建极坐标系
fig, ax = create_polar_system(r_range=(0, 5))

# 经过极点的直线的角度
alpha = np.pi / 4  

# 1. 演示经过极点的直线：θ = α
print("1. 经过极点的直线方程：θ = π/4")
theta_constant = alpha
rho_values1 = np.linspace(0, 5, 100)
theta_values1 = np.full_like(rho_values1, theta_constant)
ax.plot(theta_values1, rho_values1, 'r-', linewidth=2, label='经过极点: θ = π/4')

# 标记极点
ax.plot(0, 0, 'ro', markersize=8, label='极点')

# 添加图例和装饰
ax.legend(loc='upper right', bbox_to_anchor=(1.15, 1.15))

plt.tight_layout()
plt.show()
